package utility;

import sprite.Sprite;
import java.awt.Point;


/**
 * 
 * @author Yaqi Zhang
 * 
 */
public class Bounce {

    /**
     * bounce the sprite horizontally
     * 
     * @param s sprite
     */
    public static void apply (Sprite s, String direction) {
        if (direction.equals("Horizontally")) {
            s.setVelocity(new Point(-s.getVelocity().x, s.getVelocity().y));
        }
        else if (direction.equals("Vertically")) {
            s.setVelocity(new Point(s.getVelocity().x, -s.getVelocity().y));
        }
    }
}
